<?php
$html->addCrumb('Manager','/manager/');
$html->addCrumb('Kontakte verwalten','/manager/contactPersons/');

echo  $this->element('tasks',array('target'=>'/manager/companies'));
?>

<div class="title">Kontakte verwalten</div>
<?php echo $this->element('flashMessage') ;

//debug($this->data);
echo $this->Form->create();

?>

<table>
	<tr>
		<td style="border:none"><input type="text" name="findby_name" value="<?php echo $this->params['form']['findby_name']?>"></td>
		<td style="border:none"><input type="text" name="findby_company_name" value="<?php echo $this->params['form']['findby_company_name']?>"></td>
		<td style="border:none"  colspan="3"><input type="submit" value="Filtern"><a href="<?php echo $this->here ?>"><button>Reset Filter</button></a></td>
	</tr>
	<tr>
		<th>Name</th>
		<th>Unternehmen</th>
		<th>Telefon</th>
		<th>Email</th>
		
		<th>Aktion</th>
	</tr>

	<?php
	$out = '';
	foreach($this->data as $key => $value){
		$out .= '
		<tr>
			<td>'.$value['ContactPerson']['full_name'].'</td>
			<td>'.$value['Company']['company_name'].'</td>
			<td>'.$value['ContactPerson']['phone_number'].'</td>
			<td>'.$value['ContactPerson']['email'].'</td>
		</tr>
		';
	}
	echo $out;
	?>
</table>
<?php 
echo $this->Form->end();
?>